/*
题目描述：左旋转字符串
把字符串前面几个字符移动到字符串的后面
方法：

 */
public class E58_2 {
    public static void main(String[] args) {
        String str = "abcdefg";
        int n = 20;
        String res = LeftRotateString(str, n);
        System.out.println(res);
    }

    public static String LeftRotateString(String str,int n) {
        if(str == null || str.length() <= 1 || n <= 0){
            return str;
        }
        int len = str.length();
        n %= len;
        String res = str.substring(n, len) + str.substring(0, n);
        return res;
    }
}
/*
gabcdef
 */